/*
 * @Author: Wangtao
 * @Date: 2022-07-12 22:45:43
 * @LastEditors: Wangtao
 * @LastEditTime: 2022-08-23 15:18:16
 */

import { RouteRecordRaw } from 'vue-router'
import { appCenter } from '@/app/call-center/router/call-center-router'
import { customerRouter } from '@/app/customer/router/index'
/**
 * 管理工作台路由
 */

export const adminRoutes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'adminLayout',
    redirect: 'home',
    component: () => import(/* webpackChunkName: "adminLayout" */ '@app/base/views/layout/admin-layout/index.vue'),
    children: [
      {
        path: 'home',
        name: 'home',
        meta: {
          title: '首页'
        },
        component: () => import(/* webpackChunkName: "accountInfo" */ '@app/base/views/home/home-view.vue')
      },
      {
        path: 'account',
        name: 'account',
        meta: {
          title: '企业管理',
          roles: ['00_011']
        },
        component: () => import(/* webpackChunkName: "accountInfo" */ '@app/base/views/account/index.vue'),
        children: [
          // {
          //   path: 'account_info',
          //   name: 'accountInfo',
          //   meta: {
          //     title: '企业信息',
          //     group: 'account'
          //   },
          //   component: () =>
          //     import(/* webpackChunkName: "accountInfo" */ '@app/base/views/account/components/account-manage/account-info.vue')
          // },
          // {
          //   path: 'order_products',
          //   name: 'order_products',
          //   meta: {
          //     title: '订购产品',
          //     group: 'account'
          //   },
          //   component: () =>
          //     import(/* webpackChunkName: "accountInfo" */ '@app/base/views/account/components/account-manage/order-products.vue')
          // },
          // {
          //   path: 'notice_config',
          //   name: 'noticeConfig',
          //   meta: {
          //     title: '公告管理',
          //     group: 'notice'
          //   },
          //   component: () =>
          //     import(/* webpackChunkName: "accountInfo" */ '@app/base/views/account/components/account-manage/notice-config.vue')
          // },
          {
            path: 'global_field',
            name: 'globalField',
            meta: {
              title: '全局字段',
              group: 'globalSettings'
            },
            component: () =>
              import(/* webpackChunkName: "globalFields" */ '@app/base/views/account/components/global-field/index.vue')
          },
          {
            path: 'dynamic_form',
            name: 'dynamic_form',
            meta: {
              title: '动态表单',
              group: 'globalSettings'
            },
            component: () =>
              import(/* webpackChunkName: "dynamicForm" */ '@app/base/views/account/components/dynamic-form/index.vue')
          },
          {
            path: 'dynamic_form/edit_temp',
            name: 'edit_temp',
            meta: {
              title: '编辑模版'
            },
            component: () =>
              import(
                /* webpackChunkName: "editTemp" */ '@app/base/views/account/components/dynamic-form/components/edit-temp.vue'
              )
          },
          {
            path: 'service_time',
            name: 'serviceTime',
            meta: {
              title: '服务时间',
              group: 'globalSettings'
            },
            component: () =>
              import(/* webpackChunkName: "serviceTime" */ '@app/base/views/account/components/service-time/index.vue')
          },
          {
            path: 'service_label',
            name: 'serviceLabel',
            meta: {
              title: '服务标签',
              group: 'globalSettings'
            },
            component: () =>
              import(
                /* webpackChunkName: "accountInfo" */ '@app/base/views/account/components/service-label/service-label.vue'
              )
          },
          {
            path: 'event_push',
            name: 'eventPush',
            meta: {
              title: '事件推送',
              group: 'interface'
            },
            component: () =>
              import(/* webpackChunkName: "interface" */ '@app/base/views/account/components/event-push/index.vue')
          },
          {
            path: 'operate_log',
            name: 'operateLog',
            meta: {
              title: '操作日志',
              group: 'operateLog'
            },
            component: () =>
              import(/* webpackChunkName: "operateLog" */ '@app/base/views/account/components/event-push/index.vue')
          }
        ]
      },
      {
        path: 'transmission',
        name: 'transmission',
        meta: {
          title: '传输中心'
        },
        component: () =>
          import(/* webpackChunkName: "transmissionCenter" */ '@app/base/views/transmission-center/index.vue'),
        children: [
          {
            path: 'transmission_export',
            name: 'transmissionExport',
            meta: {
              title: '导出任务',
              group: 'transmission'
            },
            component: () =>
              import(/* webpackChunkName: "transmissionCenter" */ '@/app/base/views/transmission-center/task-list.vue')
          },
          {
            path: 'transmission_import',
            name: 'transmissionImport',
            meta: {
              title: '导入任务',
              group: 'transmission'
            },
            component: () =>
              import(/* webpackChunkName: "transmissionCenter" */ '@/app/base/views/transmission-center/task-list.vue')
          }
        ]
      },
      {
        path: 'staff',
        name: 'staff',
        meta: {
          title: '员工管理',
          roles: ['00_054']
        },
        component: () => import(/* webpackChunkName: "agentMananger" */ '@app/base/views/agent/index.vue'),
        children: [
          {
            path: 'department',
            name: 'department',
            meta: {
              title: '企业员工',
              group: 'enterprise',
              roles: ['00_055']
            },
            component: () =>
              import(
                /* webpackChunkName: "agentMananger" */ '@app/base/views/agent/enterprise-staff/index/enterprise-staff.vue'
              )
          },
          {
            path: 'department/service_group',
            name: 'service_group',
            meta: {
              group: 'enterprise',
              roles: ['00_055']
            },
            component: () =>
              import(
                /* webpackChunkName: "agentMananger" */ '@app/base/views/agent/enterprise-staff/service-group/service-group.vue'
              )
          },
          {
            path: 'department/staff_option',
            name: 'staff_option',
            meta: {
              group: 'enterprise',
              roles: ['00_055']
            },
            component: () =>
              import(
                /* webpackChunkName: "agentMananger" */ '@app/base/views/agent/enterprise-staff/staff-option/staff-option.vue'
              )
          }
          // {
          //   path: 'role',
          //   name: 'role',
          //   meta: {
          //     title: '角色权限',
          //     group: 'enterprise',
          //     roles: ['00_072']
          //   },
          //   component: () =>
          //     import(/* webpackChunkName: "agentMananger" */ '@app/base/views/agent/staff-role/role-config.vue')
          // },
          // {
          //   path: 'editRole',
          //   name: 'editRole',
          //   meta: {
          //     roles: ['00_072']
          //   },
          //   component: () =>
          //     import(/* webpackChunkName: "agentMananger" */ '@app/base/views/agent/staff-role/edit-role.vue')
          // }
        ]
      },
      {
        path: 'customer',
        name: 'customer',
        meta: {
          // title: '客户管理'
          roles: ['03_001']
        },
        component: () => import(/* webpackChunkName: "customer" */ '@app/base/views/customer/index.vue'),
        children: customerRouter
      },
      // {
      //   path: 'log',
      //   name: 'log',
      //   meta: {
      //     title: '操作日志'
      //   },
      //   component: () => import(/* webpackChunkName: "accountInfo" */ '@app/base/views/home/home-view.vue')
      // },
      {
        path: 'personal_info',
        name: 'personal_info',
        component: () => import(/* webpackChunkName: "accountInfo" */ '@app/base/views/personal-info/index.vue')
      },
      {
        path: 'app',
        name: 'app',
        // meta: {
        //   title: '应用中心'
        // },
        component: () => import(/* webpackChunkName: "config" */ '@app/base/views/config/index.vue'),
        children: appCenter
      }
    ]
  }
]
